{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "85a8fc3f",
   "metadata": {},
   "source": [
    "# 导言区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "f397dd62",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.constants as sc\n",
    "from CoolProp.CoolProp import PropsSI as psi\n",
    "from scipy.optimize import fsolve, root\n",
    "import sympy as sp\n",
    "from scipy.integrate import quad\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "79c7c6af",
   "metadata": {},
   "source": [
    "## 习题01-01"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "daa3b372",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "房间的平均温度为：138.37 C\n"
     ]
    }
   ],
   "source": [
    "t = 20\n",
    "P = 150\n",
    "l = 5\n",
    "w = 3\n",
    "h = 2.5\n",
    "tau = 10 * 3600\n",
    "fluid = 'Air'\n",
    "\n",
    "T = sc.convert_temperature(t, 'C', 'K')\n",
    "p = sc.atm\n",
    "rho = psi('D', 'T', T, 'P', p, fluid)\n",
    "V = l * w * h\n",
    "m = rho * V\n",
    "Q = P * tau\n",
    "h_1 = psi('H', 'T', T, 'P', p, fluid)\n",
    "H_1 = m * h_1\n",
    "H_2 = H_1 + Q\n",
    "h_2 = H_2 / m\n",
    "T_2 = psi('T', 'H', h_2, 'P', p, fluid)\n",
    "t_2 = sc.convert_temperature(T_2, 'K', 'C')\n",
    "print(f'房间的平均温度为：{t_2:.2f} C')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8ea4140c",
   "metadata": {},
   "source": [
    "## 习题01-02"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "89fb1fcc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "空气的质量流量为：0.068 kg/s，出口处的空气流速为：10.37 m/s\n"
     ]
    }
   ],
   "source": [
    "A_2 = 60e-4\n",
    "p_1 = 100e3\n",
    "t_1 = 25\n",
    "t_2 = 47\n",
    "P = 1500\n",
    "fluid = 'Air'\n",
    "\n",
    "T_1 = sc.convert_temperature(t_1, 'C', 'K')\n",
    "T_2 = sc.convert_temperature(t_2, 'C', 'K')\n",
    "h_1 = psi('H', 'T', T_1, 'P', p_1, fluid)\n",
    "h_2 = psi('H', 'T', T_2, 'P', p_1, fluid)\n",
    "m_dot = P / (h_2 - h_1)\n",
    "rho_2 = psi('D', 'T', T_2, 'P', p_1, fluid)\n",
    "q_v_2 = m_dot / rho_2\n",
    "v_2 = q_v_2 / A_2\n",
    "print(f\"空气的质量流量为：{m_dot:.3f} kg/s，出口处的空气流速为：{v_2:.2f} m/s\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "65d7b32d",
   "metadata": {},
   "source": [
    "## 习题01-03"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "4094abc2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "可以节省994103.89 J, 约为0.28度电\n"
     ]
    }
   ],
   "source": [
    "fluid = 'Water'\n",
    "q_v = 1000e-6/60\n",
    "t_0 = 15\n",
    "t_1 = 43\n",
    "t_2 = 38\n",
    "t_3 = 27\n",
    "tau = 15*60\n",
    "\n",
    "T_0, T_1, T_2, T_3 = sc.convert_temperature([t_0, t_1, t_2, t_3], 'C', 'K')\n",
    "p = sc.atm\n",
    "rho = psi('D', 'T', T_1, 'P', p, fluid)\n",
    "q_m = q_v*rho\n",
    "h_1 = psi('H', 'T', T_1, 'P', p, fluid)\n",
    "h_0 = psi('H', 'T', T_0, 'P', p, fluid)\n",
    "Q_1 = q_m*(h_1-h_0)\n",
    "h_3 = psi('H', 'T', T_3, 'P', p, fluid)\n",
    "Q_2 = q_m*(h_1-h_3)\n",
    "ratio = (Q_1 - Q_2)/Q_1\n",
    "saved_energy = q_m*(h_1 - h_3) * tau\n",
    "print(f'可以节省{saved_energy:.2f} J, 约为{saved_energy/(sc.hour * sc.kilo):.2f}度电')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f1630f29",
   "metadata": {},
   "source": [
    "## 习题01-09"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "cbee7d1c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "此砖墙向外界散失的热量为2076.92 J\n"
     ]
    }
   ],
   "source": [
    "A = 12\n",
    "delta = 260e-3\n",
    "lambda_ = 1.5\n",
    "t_i = 25\n",
    "t_o = -5\n",
    "\n",
    "Q = A * lambda_ * (t_i - t_o) / delta\n",
    "print(f'此砖墙向外界散失的热量为{Q:.2f} J')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "61e0b275",
   "metadata": {},
   "source": [
    "## 习题01-10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "deb56db1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "每天因热损失要用掉310.87 kg煤\n"
     ]
    }
   ],
   "source": [
    "delta = 13e-2\n",
    "A = 20\n",
    "lambda_ = 1.04\n",
    "t_i = 520\n",
    "t_o = 50\n",
    "q = 2.09e4*1e3\n",
    "tau = 1 * sc.day\n",
    "Q = A * lambda_ * (t_i - t_o) / delta\n",
    "m = Q * tau / q\n",
    "print(f'每天因热损失要用掉{m:.2f} kg煤')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35728adb",
   "metadata": {},
   "source": [
    "## 习题01-11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "导热系数为：0.06 W/m-K\n"
     ]
    }
   ],
   "source": [
    "delta = 40e-3\n",
    "q = 15\n",
    "t_o = 40\n",
    "t_i = 30\n",
    "\n",
    "lambda_ = q * delta / (t_o - t_i)\n",
    "print(f'导热系数为：{lambda_} W/m-K')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-12"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "对流传热表面传热系数为：49.30 W/(m^2-K)\n"
     ]
    }
   ],
   "source": [
    "t_w = 69\n",
    "t_f = 20\n",
    "d = 14e-3\n",
    "l = 80e-3\n",
    "P = 8.5\n",
    "\n",
    "A = np.pi * d * l\n",
    "h = P / (A * (t_w - t_f))\n",
    "print(f'对流传热表面传热系数为：{h:.2f} W/(m^2-K)')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-13"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "对流传热表面传热系数为：4405.01 W/(m^2-K)\n"
     ]
    }
   ],
   "source": [
    "p = 1.013e5\n",
    "P = 50\n",
    "d = 4e-3\n",
    "l = 10e-2\n",
    "t_s = 109\n",
    "fluid = 'Water'\n",
    "\n",
    "T = psi('T', 'P', p, 'Q', 0, fluid)\n",
    "t = sc.convert_temperature(T, 'K', 'C')\n",
    "\n",
    "\n",
    "A = np.pi * d * l\n",
    "h = P / (A * (t_s - t))\n",
    "print(f'对流传热表面传热系数为：{h:.2f} W/(m^2-K)')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-14"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "不考虑辐射时，芯片的最大允许功率为：1.59 W\n"
     ]
    }
   ],
   "source": [
    "a = b = 10e-3\n",
    "t_a = 20\n",
    "t_max = 85\n",
    "h = 175\n",
    "delta = 1e-3\n",
    "\n",
    "A = a * b + 2 * delta * a + 2 * delta * b\n",
    "Q = h * A * (t_max - t_a)\n",
    "print(f'不考虑辐射时，芯片的最大允许功率为：{Q:.2f} W')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-15"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "不考虑辐射时，芯片的最大允许功率为：1.59 W\n"
     ]
    }
   ],
   "source": [
    "a = b = 10e-3\n",
    "t_a = 20\n",
    "t_max = 85\n",
    "h = 175\n",
    "delta = 1e-3\n",
    "\n",
    "A = a * b + 2 * delta * a + 2 * delta * b\n",
    "Q = h * A * (t_max - t_a)\n",
    "print(f'不考虑辐射时，芯片的最大允许功率为：{Q:.2f} W')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-16"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "人体的散热量为：213.53 J\n",
      "有风的日子，人体的散热量为：711.77 J\n",
      "此时风冷温度为：-3.33 C\n"
     ]
    }
   ],
   "source": [
    "d = 25e-2\n",
    "height = 175e-2\n",
    "t = 30\n",
    "h_1 = 15\n",
    "t_a = 20\n",
    "h_2 = 50\n",
    "\n",
    "A = np.pi * d**2 / 4 + np.pi * d * height\n",
    "Q_1 = h_1 * A * (t - t_a)\n",
    "Q_2 = h_2 * A * (t - t_a)\n",
    "\n",
    "guess_t_a2 = 25\n",
    "t_a2 = fsolve(lambda t_a2: h_1 * (t - t_a2) - h_2 * (t - t_a), guess_t_a2)[0]\n",
    "print(f'人体的散热量为：{Q_1:.2f} J')\n",
    "print(f'有风的日子，人体的散热量为：{Q_2:.2f} J')\n",
    "print(f'此时风冷温度为：{t_a2:.2f} C')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-17"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "航天器单位表面积的换热量为：155.05 W/m^2\n"
     ]
    }
   ],
   "source": [
    "T_a = 2.7\n",
    "T = 250\n",
    "epsilon = 0.7\n",
    "q = epsilon * sc.sigma * (T ** 4 - T_a ** 4)\n",
    "print(f'航天器单位表面积的换热量为：{q:.2f} W/m^2')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-19"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "芯片的最大允许功率为：1.66 W\n"
     ]
    }
   ],
   "source": [
    "a = b = 10e-3\n",
    "t_s = 20\n",
    "t_max = 85\n",
    "h = 175\n",
    "delta = 1e-3\n",
    "\n",
    "epsilon = 0.9\n",
    "\n",
    "A = a * b + 2 * delta * a + 2 * delta * b\n",
    "T_max = sc.convert_temperature(t_max, 'C', 'K')\n",
    "T_s = sc.convert_temperature(t_s, 'C', 'K')\n",
    "Q_conv = h * A * (T_max - T_s)\n",
    "Q_radi = epsilon * sc.sigma * A * (T_max ** 4 - T_s**4)\n",
    "Q = Q_conv + Q_radi\n",
    "print(f'芯片的最大允许功率为：{Q:.2f} W')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-20"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "其外表面温度为249.22 K\n"
     ]
    }
   ],
   "source": [
    "r = 0.5\n",
    "epsilon = 0.8\n",
    "Q = 175\n",
    "T_a = 2.7\n",
    "\n",
    "A = 4 * sc.pi * r ** 2\n",
    "\n",
    "guess_T = T_a + 100\n",
    "T = fsolve(lambda T: Q - epsilon * sc.sigma * (T**4 - T_a**4), guess_T)[0]\n",
    "print(f'其外表面温度为{T:.2f} K')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-21"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "R_1 = 1.05e-02 m^2-K/W, R_2 = 1.72e-04 m^2-K/W, R_3 = 5.38e-05 m^2-K/W\n",
      "h = 93.00 W/(m^2-K)\n",
      "为了强化这一传热过程，应首先从气侧环节着手\n"
     ]
    }
   ],
   "source": [
    "h_1 = 95\n",
    "delta = 2.5e-3\n",
    "lambda_ = 46.5\n",
    "h_2 = 5800\n",
    "\n",
    "R_1 = 1 / h_1\n",
    "R_2 = 1 / h_2\n",
    "R_3 = delta / lambda_\n",
    "\n",
    "print(f'R_1 = {R_1:.2e} m^2-K/W, R_2 = {R_2:.2e} m^2-K/W, R_3 = {R_3:.2e} m^2-K/W')\n",
    "\n",
    "R = R_1 + R_2 + R_3\n",
    "h = 1 / R\n",
    "print(f'h = {h:.2f} W/(m^2-K)')\n",
    "\n",
    "position = {R_1: '气侧', R_2: '热壁', R_3: '水侧'}\n",
    "max_resistance_position = position[max(position.keys())]\n",
    "print(f'为了强化这一传热过程，应首先从{max_resistance_position}环节着手')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-22"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "h = 34.65 W/(m^2-W)\n"
     ]
    }
   ],
   "source": [
    "h_1 = 95\n",
    "delta = 2.5e-3\n",
    "lambda_ = 46.5\n",
    "h_2 = 5800\n",
    "\n",
    "delta2 = 2e-3\n",
    "lambda_2 = 0.116\n",
    "delta3 = 1e-3\n",
    "lambda_3 = 1.15\n",
    "\n",
    "R_1 = 1 / h_1\n",
    "R_2 = 1 / h_2\n",
    "R_3 = delta / lambda_\n",
    "R_4 = delta2 / lambda_2\n",
    "R_5 = delta3 / lambda_3\n",
    "\n",
    "R = R_1 + R_2 + R_3 + R_4 + R_5\n",
    "h = 1 / R\n",
    "print(f'h = {h:.2f} W/(m^2-W)')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-24"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "单位面积传递的热量为225043.02 W/m^2\n"
     ]
    }
   ],
   "source": [
    "t_w1 = 460\n",
    "t_f2 = 300\n",
    "delta_1 = 5e-3\n",
    "delta_2 = 0.5e-3\n",
    "lambda_1 = 46.5\n",
    "lambda_2 = 1.16\n",
    "h_2 = 5800\n",
    "\n",
    "R_1 = delta_1 / lambda_1\n",
    "R_2 = delta_2 / lambda_2\n",
    "R_3 = 1 / h_2\n",
    "R = R_1 + R_2 + R_3\n",
    "q = (t_w1 - t_f2) / R\n",
    "print(f'单位面积传递的热量为{q:.2f} W/m^2')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-26"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "总传热系数为：78.23 W/m^2-K\n"
     ]
    }
   ],
   "source": [
    "A = 12\n",
    "t_eva = 0\n",
    "t_i = 9.7\n",
    "t_o = 5\n",
    "Q = 6900\n",
    "\n",
    "delta_T = np.average([t_i, t_o]) - t_eva\n",
    "h = Q / (A * delta_T)\n",
    "print(f'总传热系数为：{h:.2f} W/m^2-K')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-30"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "导热系数为：64.0 W/m-K\n"
     ]
    }
   ],
   "source": [
    "t_h, t_c = 20, 0\n",
    "delta = 0.08\n",
    "t_f1 = 100\n",
    "h_1 = 200\n",
    "\n",
    "q = h_1 * (t_f1 - t_h)\n",
    "lambda_ = (q * delta) / (t_h - t_c)\n",
    "print(f\"导热系数为：{lambda_} W/m-K\")"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-31"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t_w3 = 132.68 C\n"
     ]
    }
   ],
   "source": [
    "delta = 0.1\n",
    "lambda_ = 17.5\n",
    "t_w1 = 27\n",
    "t_w2 = 127\n",
    "\n",
    "T_w1 = sc.convert_temperature(t_w1, 'C', 'K')\n",
    "T_w2 = sc.convert_temperature(t_w2, 'C', 'K')\n",
    "q = sc.sigma * (T_w2**4 - T_w1**4)\n",
    "t_w3 = t_w2 + q * delta / lambda_\n",
    "print(f\"t_w3 = {t_w3:.2f} C\")"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-32"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "通过玻璃的热损失为：57.54 W\n"
     ]
    }
   ],
   "source": [
    "a = 60e-2\n",
    "b = 30e-2\n",
    "delta = 4e-3\n",
    "t_in = 20\n",
    "t_out = -20\n",
    "h_in = 10\n",
    "h_out = 50\n",
    "lambda_ = 0.78\n",
    "\n",
    "R_1 = 1 / h_in\n",
    "R_2 = delta / lambda_\n",
    "R_3 = 1 / h_out\n",
    "R = R_1 + R_2 + R_3\n",
    "A = a * b\n",
    "Q = (t_in - t_out) / R * A\n",
    "print(f'通过玻璃的热损失为：{Q:.2f} W')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-33"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "当风速减小为原来的100%时，散热量为45.68 W\n",
      "当风速减小为原来的50%时，散热量为45.52 W\n",
      "当风速减小为原来的25%时，散热量为45.20 W\n"
     ]
    }
   ],
   "source": [
    "delta = 200e-3\n",
    "h = 3\n",
    "w = 6\n",
    "t_in = 2\n",
    "t_out = -10\n",
    "h_in = 6\n",
    "ratio_list = [1, 0.5, 0.25]\n",
    "h_out_base = 60\n",
    "h_out = h_out_base * np.array(ratio_list)\n",
    "lambda_ = 0.044\n",
    "\n",
    "R_1 = 1 / h_in\n",
    "R_2 = delta / lambda_\n",
    "R_3 = 1 / h_out\n",
    "R = R_1 + R_2 + R_3\n",
    "A = h * w\n",
    "Q = A * (t_in - t_out) / R\n",
    "for ratio, Q_ in zip(ratio_list, Q):\n",
    "    print(f'当风速减小为原来的{ratio:.0%}时，散热量为{Q_:.2f} W')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-34"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "所需的传热面积为：1.58 m^2\n"
     ]
    }
   ],
   "source": [
    "fluid1 = 'R22'\n",
    "fluid2 = 'Air'\n",
    "T_f = 313\n",
    "T_a = 283\n",
    "A_air = 0.4\n",
    "v_air = 2\n",
    "q_m = 0.011\n",
    "h = 40\n",
    "\n",
    "gamma = psi('H', 'T', T_f, 'Q', 1, fluid1) - psi('H', 'T', T_f, 'Q', 0, fluid1)\n",
    "Q = q_m * gamma\n",
    "h_in_air = psi('H', 'T', T_a, 'P', sc.atm, fluid2)\n",
    "density_air = psi('D', 'T', T_a, 'P', sc.atm, fluid2)\n",
    "m_dot_air = v_air * A_air * density_air\n",
    "h_out_air = Q / m_dot_air + h_in_air\n",
    "T_out_air = psi('T', 'H', h_out_air, 'P', sc.atm, fluid2)\n",
    "T_air_average = (T_out_air + T_a) / 2\n",
    "A = Q / h / (T_f - T_air_average)\n",
    "print(f\"所需的传热面积为：{A:.2f} m^2\")"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-35"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "所需的对流传热系数为：125.00 W/m^2-K\n",
      "热辐射带走的热量为：5.24 W\n"
     ]
    }
   ],
   "source": [
    "A = 0.2\n",
    "t = 65\n",
    "t_a = 25\n",
    "Q = 1000\n",
    "\n",
    "h = Q / (A * (t - t_a))\n",
    "print(f'所需的对流传热系数为：{h:.2f} W/m^2-K')\n",
    "\n",
    "t_s = 30\n",
    "epsilon = 0.85\n",
    "T_s = sc.convert_temperature(t_s, 'C', 'K')\n",
    "T_a = sc.convert_temperature(t_a, 'C', 'K')\n",
    "Q_radiation = epsilon * sc.sigma * A * (T_s**4 - T_a**4)\n",
    "print(f'热辐射带走的热量为：{Q_radiation:.2f} W')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-36"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "叶子的导热处于非稳态\n"
     ]
    }
   ],
   "source": [
    "A_i = 200e-6\n",
    "t_fi = 700\n",
    "h_i = 320\n",
    "A_o = 2840e-6\n",
    "t_f = 1000\n",
    "h_o = 1420\n",
    "t_o = 820\n",
    "t_i = 790\n",
    "\n",
    "Q_in = h_i * (t_i - t_fi) * A_i\n",
    "Q_out = h_o * (t_f - t_o) * A_o\n",
    "if abs(Q_in - Q_out) < 0.05 * min(Q_in, Q_out):\n",
    "    print(\"叶片的导热处于稳态\")\n",
    "else:\n",
    "    print(\"叶子的导热处于非稳态\")"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-37"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "模拟仓表面的辐射散热量为：39.70 W\n",
      "这份能量不都是宇航员身上散失的，还有部分是舱内仪表散失的\n"
     ]
    }
   ],
   "source": [
    "A_out = 3\n",
    "t_out = 0\n",
    "epsilon = 0.05\n",
    "t_a = -100\n",
    "\n",
    "T_out = sc.convert_temperature(t_out, 'C', 'K')\n",
    "T_a = sc.convert_temperature(t_a, 'C', 'K')\n",
    "\n",
    "Q = epsilon * sc.sigma * A_out * (T_out**4 - T_a**4)\n",
    "print(f'模拟仓表面的辐射散热量为：{Q:.2f} W')\n",
    "print(f'这份能量不都是宇航员身上散失的，还有部分是舱内仪表散失的')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-38"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "该男子向环境散热的方式有对流和辐射\n",
      "辐射总换热量为： 632095 J\n",
      "对流总换热量为： 2464378 J\n"
     ]
    }
   ],
   "source": [
    "print('该男子向环境散热的方式有对流和辐射')\n",
    "\n",
    "epsilon = 0.9\n",
    "t_initial = 31\n",
    "t_amb = 10\n",
    "h = 20\n",
    "d = 0.318\n",
    "height = 1.7\n",
    "\n",
    "T_initial = sc.convert_temperature(t_initial, 'C', 'K')\n",
    "T_amb = sc.convert_temperature(t_amb, 'C', 'K')\n",
    "A = np.pi * d**2 / 4 + np.pi * d * height\n",
    "\n",
    "Phi_1 = 400\n",
    "# Phi_2 = 800\n",
    "C = 5e5\n",
    "tau = 1 * sc.hour\n",
    "\n",
    "# Phi = Phi_2 - Phi_1\n",
    "# Delta_T = Phi / C * tau\n",
    "# T_final = T_initial - Delta_T\n",
    "\n",
    "T, Q_rad, Q_conv = sp.Symbol('T'), sp.Symbol('Q_rad'), sp.Symbol('Q_conv')\n",
    "Q_rad = epsilon * sc.sigma * A * (T**4 - T_amb**4)\n",
    "Q_conv = h * A * (T - T_amb)\n",
    "dQ_dtau = Q_rad + Q_conv - Phi_1\n",
    "dQ_dT = C\n",
    "dtau_dT = dQ_dT / dQ_dtau\n",
    "\n",
    "dQrad_dT = sp.lambdify(T, -Q_rad * dtau_dT, 'numpy')\n",
    "dQconv_dT = sp.lambdify(T, -Q_conv * dtau_dT, 'numpy')\n",
    "\n",
    "\n",
    "def expressions(p):\n",
    "    Q_rad_total, Q_conv_total, T_final = p\n",
    "    exp1 = Q_rad_total - quad(dQrad_dT, T_initial, T_final)[0]\n",
    "    exp2 = Q_conv_total - quad(dQconv_dT, T_initial, T_final)[0]\n",
    "    exp3 = (Q_rad_total + Q_conv_total - Phi_1 * tau) - C * (T_initial - T_final)\n",
    "    return [exp1, exp2, exp3]\n",
    "# Q_rad_total = sp.integrate(-Q_rad * dtau_dT, (T, T_initial, T_final))\n",
    "# Q_conv_total = sp.integrate(-Q_conv * dtau_dT, (T, T_initial, T_final))\n",
    "\n",
    "\n",
    "guess_value = [1e6, 1e6, T_initial - 4]\n",
    "Q_rad_total, Q_conv_total, T_final = root(expressions, guess_value).x\n",
    "\n",
    "print(f'辐射总换热量为： {Q_rad_total:.0f} J')\n",
    "print(f'对流总换热量为： {Q_conv_total:.0f} J')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-41"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "当传热系数为10 W/m^2-K 时，散热量为44.89 W\n",
      "当传热系数为15 W/m^2-K 时，散热量为45.20 W\n",
      "当传热系数为25 W/m^2-K 时，散热量为45.45 W\n",
      "当传热系数为32 W/m^2-K 时，散热量为45.54 W\n",
      "当传热系数为45 W/m^2-K 时，散热量为45.62 W\n",
      "当传热系数为60 W/m^2-K 时，散热量为45.68 W\n"
     ]
    },
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEYCAYAAACp5wpbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAzdklEQVR4nO3deXxU5dn/8c9FCFtYAiQgWwg7rlSIqAiuKArYuraWqkVbqW21LRXa0sfnZ2tbu2gX7E7RVq1btVZbfSzVugAisoiIoiyyg2gChCWEJcn1++M+gSFmyICZmSzf9+s1L+acOct1JnquuZdz3+buiIiIVKdJugMQEZG6S0lCRETiUpIQEZG4lCRERCQuJQkREYlLSUIaLTNrY2aW7jhE6jIlCUkZM9sY/fuKmfWI3l9uZn+oZtshZvZQzPIwM7v3MMeeZWZzzeylKq9XzWxBnN1WAiMSjL2Nmd1iZpnR8pfM7JLDbH9E8Vezf5aZnWhm48zsZ2bWKuazs82sv5ndZ2YXmtkoM2tvZpeY2a1xjnesmb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VDM/s+Yf6M/we0AVYTRkpdAFxrZmvd/Skzawb8lHDT/Q1hPK8TgL+a2Xh3X08YevstwlDrTxNGHB0VbfcqsLGGuOcQEsQwQommW/R+O2E4c6LjXRezz2p3XxJdy9vAf93dzWwJkA/g7ncTqo2qs4pQfbUmZt3+KJYvEEYFrqpBzuYmR07VTVIvufvDwDsxq9oDp1qYsnOrmV0d89n5hIlZSgk35hvc/cvAw4ShtXOj7a4gDBB3DvA1QmnhbkK7w7/MrANwOfA/wJcIVVY/dPefEgZLvARYVCXUPWaWFbP8CiEpnEhINnMJJYlhwJzoV392ZRtIZG/M+4qY5QoS+6F3MrC+yroKQvvIUDP7buwHUbyliKCShDQc/yWM8rqLMAHNX2M+W0NIACMIN/d8MxtGuLG/5O7TAdz9ITP7EFgSffZDQmllCGEK1K3A7yzMcvcJQkKobNN4kNBO0btKXP8GLgUq45lDqOpaFQ1fvtXMsgltFDcQElStDm3t7u/HWb/bzMYAs8zsA3e/J/roUmBGbcYg9ZdKElKfxVaJtCNUJ/2H0G01bGCWAdwB7CHciM8HnFCdMwf4bOUvfTO7mFD1EvvLfTehEfdLUc8mgF8TGr3HA1+J2hi+Sqhqqjpt5D+BS6JSCIQElEMoQRCzbru7FwFV2yOSKkp8FwK3mtknozg/BTyVqhikjnN3vfSqly/gOGBalXXXAfOA5tFyN+C66H0uoZG5CdAtWnc60JLQqP1jQgliAOFG/YNoGwO+ArQg1O3/C/g2kEFIPIuBMYQpI18FTq0SUz5wbYLX9DqQmcbv9PNAr3T/bfWqOy/NJyENjpl18PAL+Wj3zwQGuPtbcT7D3ffHrGvp7qXR+yYeJqMXaRCUJEREJC61SYiISFxKEiIiEpeShIiIxKUkISIicSlJiIhIXEoSIiISl5KEiIjEpSQhIiJx/X/vNOxXZi/ydgAAAABJRU5ErkJggg==\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "delta = 200e-3\n",
    "h = 3\n",
    "w = 6\n",
    "t_in = 2\n",
    "t_out = -10\n",
    "h_in = 6\n",
    "# ratio_list = [1, 0.5, 0.25]\n",
    "# h_out_base = 60\n",
    "h_out = np.array([10, 15, 25, 32, 45, 60])\n",
    "lambda_ = 0.044\n",
    "\n",
    "R_1 = 1 / h_in\n",
    "R_2 = delta / lambda_\n",
    "R_3 = 1 / h_out\n",
    "R = R_1 + R_2 + R_3\n",
    "A = h * w\n",
    "Q = A * (t_in - t_out) / R\n",
    "for h, Q_ in zip(h_out, Q):\n",
    "    print(f'当传热系数为{h} W/m^2-K 时，散热量为{Q_:.2f} W')\n",
    "fig, ax = plt.subplots()\n",
    "ax.plot(h_out, Q, 'o-')\n",
    "ax.set_xlabel('传热系数($\\mathrm{W/m^2\\cdot K}$)')\n",
    "ax.set_ylabel('散热量($\\mathrm{W}$)')\n",
    "ax.set_title('散热量与传热系数的关系')\n",
    "plt.show()\n"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 习题01-42"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "$T = 799.50 K$\n",
      "$t = 526.35 C$\n"
     ]
    }
   ],
   "source": [
    "Q = 1200    # 电熨斗的功率，课本缺失\n",
    "A = 300e-4\n",
    "epsilon = 0.9\n",
    "t_a = 25\n",
    "h = 39\n",
    "\n",
    "T_a = sc.convert_temperature(t_a, 'C', 'K')\n",
    "\n",
    "\n",
    "def expressions(p):\n",
    "    Q_rad, Q_conv, T = p\n",
    "    exp1 = Q_rad - epsilon * sc.sigma * A * (T**4 - T_a**4)\n",
    "    exp2 = Q_conv - h * A * (T - T_a)\n",
    "    exp3 = Q_rad + Q_conv - Q\n",
    "    return [exp1, exp2, exp3]\n",
    "\n",
    "\n",
    "guess_value = [Q/2, Q/2, T_a + 10]\n",
    "Q_rad, Q_conv, T = root(expressions, guess_value).x\n",
    "t = sc.convert_temperature(T, 'K', 'C')\n",
    "print(f'T = {T:.2f} K')\n",
    "print(f't = {t:.2f} C')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
